{{- block "header" .}}
<link href="/css/bootstrap-table.min.css" rel="stylesheet">
<link href="/css/bootstrap-table-reorder-rows.min.css" rel="stylesheet">
<link href="/css/bootstrap4-toggle.css" rel="stylesheet">
<link href="/css/bootstrap-select.min.css" rel="stylesheet">
<link href="/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">

{{- end}}
{{ block "content" .data}}
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
    <h1 class="h2">新建路由</h1>
</div>
<form  class="container">
    <div class="mt-2">
        <div>
            <label for="inputId">Id</label>
        </div>
        <div>
            <input class="form-control form-control-sm" type="text" id="inputId"/>
        </div>
    </div>
    <div class="mt-2">
        <div><label for="inputName">Name</label>
            <small id="passwordHelpInline" class="text-muted">
                只能使用英文字母、数字、下划线
            </small></div>

        <div>
            <input class="form-control form-control-sm" type="text" id="inputName" required/>
            <div class="invalid-feedback">
                Name 格式错误
            </div>
        </div>

    </div>
    <div class="mt-2">
        <div><label for="inputDrivers">Driver</label></div>
        <div>
            <select class="form-control form-control-sm" id="inputDrivers"></select>
        </div>
    </div>
    <div class="mt-2">
        <div>
            <label for="inputDescription">描述</label>
        </div>
        <div>
            <textarea class="form-control" rows="3"  type="text" id="inputDescription"></textarea>
        </div>
    </div>
    <div id="formRenderPanel">

    </div>
    <div id="form_button" class="row justify-content-between" style="display: none">
        <div class="col-4">
            <button type="button" name="reset" class="btn btn-outline-secondary form_reset">重置</button>
        </div>
        <div class="col-4" style="text-align: right">
            <button type="button" name="submit" class="btn btn-primary form_submit">提交</button>
        </div>
    </div>
</form>
{{end}}
{{- block "script" . -}}
<script src="/js/jquery.tablednd.min.js"></script>
<script src="/js/bootstrap-table.min.js"></script>
<script src="/js/bootstrap4-toggle.min.js"></script>
<script src="/js/bootstrap-table-reorder-rows.min.js"></script>
<script src="/js/bootstrap-select.min.js"></script>

<script type="text/javascript" src="/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>

<script src="/js/djv.js"></script>
<script src="/js/form-render.js"></script>
<script src="/js/render.js"></script>
<script>

    const ModuleName = function (){
        return "{{.module.Name}}"
    }
    function Back(){
        window.location.href = '/{{.module.Name}}/list'
    }
    $(document).ready(function () {
        let creator = new ProfessionCreator("{{.name}}", {
            "profession":"{{.data}}",
            "panel":$("#formRenderPanel"),
            "drivers":$("#inputDrivers"),
            "name":$("#inputName"),
            "id":$("#inputId"),
            "btns":$("#form_button"),
            "description":$("#inputDescription"),

        })
    })
</script>

{{- end -}}